var apiMWAP_bg{};
apiMWAP_bg.logFull = "";
apiMWAP_bg.log = function(logtext){
	console.log( logtext);
	apiMWAP_bg.logFull += logtext +"\n";
}

apiMWAP_bg.className = "apiMWAP_bg";
apiMWAP_bg.scriptIDs = [];
apiMWAP_bg.addScript = function ( id, src){
	var script = document.getElementById(id);
	if (script ) return;
	script=document.createElement('script');
	script.type='text/javascript';
	script.id = id;
	script.src=src;;
	var headArr = document.getElementsByTagName('head');
	var theHead = headArr[0];
	theHead.appendChild(script);
}
apiMWAP_bg.onload = function (){
	console.log("background_onload START");
}
apiMWAP_bg.initapi = function( request){
	apiMWAP_bg.logFull = "";
	var response = {}
	if( request.scriptid && request.scriptsrc){
    	apiMWAP_bg.addScript( request.scriptid,request.scriptsrc);
    		//addscript( 'sp_adin','http://mafia.stealthpartner.com/mafia/addin.mwap.js?open&rnd'+Math.random()');
	}
	response = apiMWAP_bg.logFull;
	return response;
}
apiMWAP_bg.pagechange = function( request){
	var response = {}
	response.AAA = "";
	return response;
}
